package com.fq.fq_system.controller;


import com.fq.fq_system.entity.User;
import com.fq.fq_system.mapper.UserMapper;
import com.fq.fq_system.result.Result;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * 用户控制类【仅供测试】
 */
@RestController
@RequestMapping("/user")
@Slf4j
public class UserController {


    private UserMapper userMapper;

    public UserController(UserMapper userMapper) {
        this.userMapper = userMapper;
    }


    @GetMapping
    public Result getAllUsers(){
        List<User> users=userMapper.getAllUsers();
        return Result.success(users);
    }

}
